package com.puzzlebazar.client.squaregrid.view;

import com.puzzlebazar.client.util.ObservableImpl;
import com.puzzlebazar.client.util.Recti;
import com.puzzlebazar.client.util.Vec2i;

public class HighlightConstraintsBasic extends ObservableImpl 
	implements HighlightConstraints {

	private final boolean handleCells;
	private final boolean handleEdges;
	private final boolean handleVertices;
	
	/**
	 * Construct a simple set of highlighting constraints that allows for highlighting
	 * all the cells, edges and/or vertices
	 * 
	 * @param handleCell True to handle cell highlighting
	 * @param handleEdges True to handle edge highlighting
	 * @param handleVertices True to handle vertex highlighting
	 */
	public HighlightConstraintsBasic( 
			boolean handleCell,
			boolean handleEdges,
			boolean handleVertices ) {
		this.handleCells = handleCell;
		this.handleEdges = handleEdges;
		this.handleVertices = handleVertices;
	}
	
	@Override
	public boolean canHandleCell(Vec2i cellLoc) {
		return handleCells;
	}

	@Override
	public boolean canHandleHorizontalEdge(Vec2i edgeLoc) {
		return handleEdges;
	}

	@Override
	public boolean canHandleVertex(Vec2i vertexLoc) {
		return handleEdges;
	}

	@Override
	public boolean canHandleVerticalEdge(Vec2i edgeLoc) {
		return handleVertices;
	}

	@Override
	public Recti cellGroup(Vec2i cellLoc) {
		return null;
	}

}
